//
//  BaseCard.swift
//  ShimaPlayer
//
//  Created by Miracolo Bosco on 2025/7/7.
//

import UIKit

class BaseCard: UIView {

    var bgColor: UIColor? = .white
    
    var cornerRadius: CGFloat {
        25
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    convenience init(color: UIColor) {
        self.init(frame: .zero)
        bgColor = color
        setupUI()
    }

    func setupUI() {    
        backgroundColor = bgColor
        layer.cornerRadius = cornerRadius
        layer.shadowColor = UIColor(hexString: "000000")?.withAlphaComponent(0.1).cgColor
        layer.shadowOffset = CGSize(width: 0, height: 4)
        layer.shadowOpacity = 1
        layer.shadowRadius = 4
        layer.masksToBounds = false
    }
}
